#include <bits/stdc++.h>
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int jinjin = 0, mom = 0, cost;
	for (int i = 1; i <= 12; ++i)
	{
		jinjin += 300;
		cin >> cost;
		jinjin -= cost;
		if (jinjin < 0)
		{
			cout << '-' << i;
			return 0;
		}
		mom += jinjin - jinjin % 100;
		jinjin %= 100;
	}
	cout << jinjin + mom * 1.2;
	return 0;
}
